package com.piece.core.oauth.config;

import org.springframework.core.Ordered;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;

public interface WebSecurityProvider extends Ordered {

    /**
     * 配置authenticationProvider
     */
    default void configure(AuthenticationManagerBuilder auth) throws Exception {}

    /**
     * 配置HttpSecurity，会立即配置
     *
     * @param httpSecurity
     * @throws Exception
     */
    default void configure(HttpSecurity httpSecurity) throws Exception {}

    /**
     * 配置WebSecurity，会立即配置
     *
     * @param webSecurity
     * @throws Exception
     */
    default void configure(WebSecurity webSecurity) throws Exception {}
}